home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / gle / util / surf / global.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-29  |  8.4 KB  |  275 lines

  1. #define typ_end 0
  2. #define typ_val 1
  3. #define typ_val2 2
  4. #define typ_str 3
  5. #define typ_switch 4
  6. #define typ_color 5
  7. #define typ_fill 6
  8. #define typ_marker 7
  9. #define typ_lstyle 8
  10. #define typ_justify 9
  11. #define typ_arrow 10
  12.  
  13. /* pos=   Offset to find the data            */
  14. /* idx=   For switches, which can only have one value.     */
  15. /* The pos is the order the items will be placed in the pcode */
  16. /*
  17. /* Switches     LONG     placed in directly, 1 present, 0 not present
  18. /* expressions     LONG*     pointed to, 0 if not present.
  19. /* color/fill    LONG*     Pointer to exp 0 if not present.
  20. /* marker    LONG*    Pointer to exp 0 if not present.
  21. /* lstyle     LONG*    Pointer to exp 0 if not present.
  22. /* font     long*     Pointer to string expression.
  23. */
  24. /*---------------------------------------------------------------------------*/
  25.  
  26. char *zzzmainkey[] = {
  27. "","ALINE", "RLINE", "AMOVE", "RMOVE", "BOX"
  28. , "BEGIN" , "CIRCLE", "FOR", "NEXT", "SET"
  29. , "BEZIER", "RBEZIER", "ARCTO", "ARC", "NARC"
  30. , "CURV", "PIE", "MARKER", "TEXT", "END"
  31. , "IF", "ELSE", "GOTO", "GSAVE", "DEFINE"
  32. , "REGION", "UNTIL", "WHILE", "WRITE", "SUB"
  33. , "DFONT", "CLOSEPATH", "NEWPATH", "SCALE", "ROTATE"
  34. , "TRANSLATE", "ICON" , "INCLUDE", "JOIN", "SAVE"
  35. , "MOVE", "REVERSE", "FILL", "STROKE", "FOPEN"
  36. , "FCLOSE", "INPUT", "PRINT", "LET" };
  37.  
  38.  
  39. struct op_key op_box[] = {
  40.          "JUSTIFY",     typ_justify,     1, 0
  41.         ,"JUST",     typ_justify,     1, 0
  42.         ,"NOSTROKE",     typ_switch,     2, 1
  43.         ,"NOBORDER",     typ_switch,     2, 1
  44.         ,"NOBOX",     typ_switch,     2, 1
  45.         ,"FILL",     typ_fill,     3, 0
  46.         ,"NAME",     typ_str,     4, 0
  47.         ,"END",     typ_end,     0, 0  };
  48. struct op_key op_circle[] = {
  49.          "JUSTIFY",     typ_justify,     1, 0
  50.         ,"JUST",     typ_justify,     1, 0
  51.         ,"NOSTROKE",     typ_switch,     2, 1
  52.         ,"FILL",     typ_fill,     3, 0
  53.         ,"NAME",     typ_str,     4, 0
  54.         ,"END",     typ_end,     0, 0  };
  55. struct op_key op_fill[] = {
  56.          "FILL",     typ_fill,     1, 0
  57.         ,"END",     typ_end,     0, 0  };
  58. struct op_key op_for_step[] = {
  59.          "STEP",     typ_val,     1, 0
  60.         ,"END",     typ_end,     0, 0  };
  61. struct op_key op_begin_text[] = {
  62.          "WIDTH",     typ_val,     1, 0
  63.         ,"DEPTH",     typ_val,     2, 0
  64.         ,"END",     typ_end,     0, 0  };
  65.  
  66. /* JUSTIFY:  stored as a long word string. 'LEFT', 'CENT', 'RIGH', 'LT' */
  67. struct op_key op_justify[] = {
  68.          "LEFT",     typ_switch,     1, 0x100
  69.         ,"CENT",     typ_switch,     1, 0x110
  70.         ,"CENTER",     typ_switch,     1, 0x110
  71.         ,"CENTRE",     typ_switch,     1, 0x110
  72.         ,"RIGHT",     typ_switch,     1, 0x120
  73.         ,"LT",         typ_switch,     1, 0x02
  74.         ,"TL",         typ_switch,     1, 0x02
  75.         ,"CL",         typ_switch,     1, 0x01
  76.         ,"LC",         typ_switch,     1, 0x01
  77.         ,"BL",         typ_switch,     1, 0x00
  78.         ,"LB",         typ_switch,     1, 0x00
  79.         ,"CB",         typ_switch,     1, 0x10
  80.         ,"BC",         typ_switch,     1, 0x10
  81.         ,"RB",         typ_switch,     1, 0x20
  82.         ,"BR",         typ_switch,     1, 0x20
  83.         ,"CR",         typ_switch,     1, 0x21
  84.         ,"RC",         typ_switch,     1, 0x21
  85.         ,"TR",         typ_switch,     1, 0x22
  86.         ,"RT",         typ_switch,     1, 0x22
  87.         ,"TC",         typ_switch,     1, 0x12
  88.         ,"CT",         typ_switch,     1, 0x12
  89.         ,"CC",         typ_switch,     1, 0x11
  90.         ,"CI",         typ_switch,     1, 0x1011
  91.         ,"C",         typ_switch,     1, 0x1011
  92.         ,"VI",         typ_switch,     1, 0x2000
  93.         ,"V",         typ_switch,     1, 0x2000
  94.         ,"HO",         typ_switch,     1, 0x3000
  95.         ,"H",         typ_switch,     1, 0x3000
  96.         ,"BOX",         typ_switch,     1, 0x5011
  97.         ,"BO",         typ_switch,     1, 0x5011
  98.         ,"END",     typ_end,     1, 1 };
  99. struct op_key op_begin[] = {
  100.          "PATH",     typ_switch,     1, 1
  101.         ,"BOX",     typ_switch,     1, 2
  102.         ,"SCALE",     typ_switch,     1, 3
  103.         ,"ROTATE",     typ_switch,     1, 4
  104.         ,"TRANSLATE",     typ_switch,     1, 5
  105.         ,"ROT",     typ_switch,     1, 4
  106.         ,"TRAN",     typ_switch,     1, 5
  107.         ,"IF",         typ_switch,     1, 6
  108.         ,"SUB",     typ_switch,     1, 7
  109.         ,"NAME",     typ_switch,     1, 8
  110.         ,"TEXT",     typ_switch,     1, 9
  111.         ,"GRAPH",     typ_switch,     1, 10
  112.         ,"XAXIS",     typ_switch,     1, 11
  113.         ,"YAXIS",     typ_switch,     1, 12
  114.         ,"X2AXIS",     typ_switch,     1, 13
  115.         ,"Y2AXIS",     typ_switch,     1, 14
  116.         ,"CURVE",    typ_switch,    1,15
  117.         ,"KEY",        typ_switch,    1,16
  118.         ,"ORIGIN",    typ_switch,    1,17
  119.         ,"TABLE",    typ_switch,    1,18
  120.         ,"CLIP",    typ_switch,    1,19
  121.         ,"END",     typ_end,     1, 1 };
  122. struct op_key op_set[] = {
  123.          "HEI",     typ_switch,     1, 1
  124.         ,"FONT",     typ_switch,     1, 2
  125.         ,"JUSTIFY",     typ_switch,     1, 3
  126.         ,"JUST",     typ_switch,     1, 3
  127.         ,"COLOR",     typ_switch,     1, 4
  128.         ,"DASHLEN",     typ_switch,     1, 5
  129.         ,"DASH",     typ_switch,     1, 6
  130.         ,"LDIST",     typ_switch,     1, 5
  131.         ,"LSTYLE",     typ_switch,     1, 6
  132.         ,"LWIDTH",     typ_switch,     1, 7
  133.         ,"JOIN",     typ_switch,     1, 8
  134.         ,"CAP",     typ_switch,     1, 9
  135.         ,"FONTLWIDTH",     typ_switch,     1, 10
  136.         ,"END",     typ_end,     1, 1 };
  137. /* colors, fills,  First byte is pattern, then red,green,blue intensities*/
  138. /* currently defined patterns are,  ff=clear, 1=black,  */
  139. struct op_key op_color_typ[] = {
  140.          "CLEAR",     typ_switch,     1, 0XFF000000
  141.         ,"BLACK",     typ_switch,     1, 0X01000000
  142.         ,"WHITE",     typ_switch,     1, 0X01FFFFFF
  143.         ,"RED",     typ_switch,     1, 0X01FF0000
  144.         ,"GREEN",     typ_switch,     1, 0X0100FF00
  145.         ,"BLUE",     typ_switch,     1, 0X010000FF
  146.         ,"MAGENTA",     typ_switch,     1, 0X01FFFF00
  147.         ,"YELLOW",     typ_switch,     1, 0X0100FFFF
  148.         ,"GREY",     typ_switch,     1, 0X017F7F7F
  149.         ,"GREY90",     typ_switch,     1, 0X01060606
  150.         ,"GREY80",     typ_switch,     1, 0X01191919
  151.         ,"GREY70",     typ_switch,     1, 0X01323232
  152.         ,"GREY60",     typ_switch,     1, 0X014b4b4b
  153.         ,"GREY50",     typ_switch,     1, 0X01646464
  154.         ,"GREY40",     typ_switch,     1, 0X017d7d7d
  155.         ,"GREY30",     typ_switch,     1, 0X01969696
  156.         ,"GREY20",     typ_switch,     1, 0X01afafaf
  157.         ,"GREY10",     typ_switch,     1, 0X01c8c8c8
  158.         ,"GREY5",     typ_switch,     1, 0X01f0f0f0
  159.         ,"GREY1",     typ_switch,     1, 0X01fdfdfd
  160.         ,"GRID",     typ_switch,     1, 0X02002020
  161.         ,"GRID1",     typ_switch,     1, 0X02040f0f
  162.         ,"GRID2",     typ_switch,     1, 0X02001010
  163.         ,"GRID3",     typ_switch,     1, 0X02052020
  164.         ,"GRID4",     typ_switch,     1, 0X02104040
  165.         ,"GRID5",     typ_switch,     1, 0X02206060
  166.         ,"SHADE",     typ_switch,     1, 0X02000020
  167.         ,"SHADE1",     typ_switch,     1, 0X0204000C
  168.         ,"SHADE2",     typ_switch,     1, 0X02000010
  169.         ,"SHADE3",     typ_switch,     1, 0X02050020
  170.         ,"SHADE4",     typ_switch,     1, 0X02100040
  171.         ,"SHADE5",     typ_switch,     1, 0X02200060
  172.         ,"RSHADE",     typ_switch,     1, 0X02002000
  173.         ,"RSHADE1",     typ_switch,     1, 0X02040C00
  174.         ,"RSHADE2",     typ_switch,     1, 0X02001000
  175.         ,"RSHADE3",     typ_switch,     1, 0X02052000
  176.         ,"RSHADE4",     typ_switch,     1, 0X02104000
  177.         ,"RSHADE5",     typ_switch,     1, 0X02206000
  178.         ,"END",     typ_end,     1, 1 };
  179. struct op_key op_marker[] = {
  180.         "DOT",     typ_switch,     1, 1
  181.         ,"CROSS",     typ_switch,     1, 2
  182.         ,"FCIRCLE",     typ_switch,     1, 3
  183.         ,"FSQUARE",     typ_switch,     1, 4
  184.         ,"FTRIANGLE",     typ_switch,     1, 5
  185.         ,"FDIAMOND",     typ_switch,     1, 6
  186.         ,"CIRCLE",     typ_switch,     1, 7
  187.         ,"SQUARE",     typ_switch,     1, 8
  188.         ,"TRIANGLE",     typ_switch,     1, 9
  189.         ,"DIAMOND",     typ_switch,     1, 10
  190.         ,"PLUS",     typ_switch,     1, 11
  191.         ,"CLUB",     typ_switch,     1, 12
  192.         ,"HEART",     typ_switch,     1, 13
  193.         ,"DIAMOND",     typ_switch,     1, 14
  194.         ,"SPADE",     typ_switch,     1, 15
  195.         ,"STAR",     typ_switch,     1, 16
  196.         ,"SNAKE",     typ_switch,     1, 17
  197.         ,"DAG",     typ_switch,     1, 18
  198.         ,"DDAG",     typ_switch,     1, 19
  199.         ,"ASTERIX",     typ_switch,     1, 20
  200.         ,"OPLUS",     typ_switch,     1, 21
  201.         ,"OMINUS",     typ_switch,     1, 22
  202.         ,"OTIMES",     typ_switch,     1, 23
  203.         ,"ODOT",     typ_switch,     1, 24
  204.         ,"TRIANGLEZ",     typ_switch,     1, 25
  205.         ,"DIAMONDZ",     typ_switch,     1, 26
  206.         ,"WCIRCLE",     typ_switch,     1, 27
  207.         ,"WTRIANGLE",     typ_switch,     1, 28
  208.         ,"WSQUARE",     typ_switch,     1, 29
  209.         ,"WDIAMOND",     typ_switch,     1, 30
  210.         ,"END",     typ_end,     1, 1 };
  211.  
  212. struct op_key op_begin_path[] = {
  213.          "STROKE",     typ_switch,     1, 1
  214.         ,"FILL",     typ_fill,     2, 0
  215.         ,"CLIP",     typ_switch,     3, 1
  216.         ,"END",     typ_end,     0, 0 };
  217. struct op_key op_begin_box[] = {
  218.          "ADD",     typ_val,     1, 0
  219.         ,"FILL",     typ_fill,     2, 0
  220.         ,"NOSTROKE",     typ_switch,     3, 1
  221.         ,"NOBORDER",     typ_switch,     3, 1
  222.         ,"NOBOX",     typ_switch,     3, 1
  223.         ,"NAME",     typ_str,     4, 0
  224.         ,"END",     typ_end,     0, 0 };
  225. struct op_key op_begin_scale[] = {
  226.          "TRANSLATE",     typ_val2,     1, 0
  227.         ,"TRAN",     typ_val2,     1, 0
  228.         ,"SCALE",     typ_val2,     3, 0
  229.         ,"ROTATE",     typ_val,     5, 0
  230.         ,"ROT",     typ_val,     5, 0
  231.         ,"END",     typ_end,     0, 0 };
  232. struct op_key op_arrow[] = {
  233.          "START",     typ_switch,     1, 1
  234.         ,"END",     typ_switch,     1, 2
  235.         ,"BOTH",     typ_switch,     1, 3
  236.         ,"END",     typ_end,     0, 0 };
  237. struct op_key op_joinname[] = {
  238.          "->",         typ_switch,     1, 1
  239.         ,"<-",         typ_switch,     1, 2
  240.         ,"<->",     typ_switch,     1, 3
  241.         ,"-",         typ_switch,     1, 4
  242.         ,"END",     typ_end,     0, 0 };
  243. struct op_key op_line[] = {
  244.          "ARROW",     typ_arrow,     1, 1
  245.         ,"END",     typ_end,     0, 0 };
  246. struct op_key op_size[] = {
  247.          "BOX",     typ_switch,     1, 1
  248.         ,"END",     typ_end,     0, 0 };
  249.  
  250. struct op_key op_join[] = {
  251.          "MITRE",     typ_switch,     1, 0
  252.         ,"ROUND",     typ_switch,     1, 1
  253.         ,"BEVEL",     typ_switch,     1, 2
  254.         ,"END",     typ_end,     0, 0 };
  255. struct op_key op_cap[] = {
  256.          "BUTT",     typ_switch,     1, 0
  257.         ,"ROUND",     typ_switch,     1, 1
  258.         ,"SQUARE",     typ_switch,     1, 2
  259.         ,"END",     typ_end,     0, 0 };
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.                                                                                                                        
  275.